package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

/*
*   自定义的异常类
* */
@Data
public class LeaseException extends RuntimeException {

    private int code;
    public LeaseException(int code, String message) {
        super(message);
        this.code = code;
    }
    public LeaseException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
